package io.coderyeah.ymcc.web.controller;

import io.coderyeah.ymcc.result.JSONResult;
import io.coderyeah.ymcc.service.ITokenService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

/**
 * @author lqs
 * @date 2022/11/1 19:34
 */
@RestController
@RequestMapping("/courseOrder")
public class TokenController {
    @Autowired
    private ITokenService tokenService;

    @GetMapping("/createTokenForOrder/{ids}")
    public JSONResult createTokenForOrder(@PathVariable("ids") String ids) {
        String token = tokenService.getOrderToken(ids);
        return JSONResult.success(token);
    }
}
